package com.hsgene.order.constants.v1;

import com.google.common.collect.Lists;
import com.hsgene.common.util.exception.IllegalParamException;

import java.util.List;

/**
 * 花生仁订单列表项分类枚举
 *
 * @author wangbing
 * @version 1.0, 2018/9/18
 */
public enum PeanutOrderListType {

    /**
     * 订单列表项分类枚举
     */
    NEW("new", "新订单"),

    ON_GONGING("ongoing", "进行中"),

    END("end", "已结束"),

    ADDITION("addition", "样本补寄");

    private final String value;

    private final String desc;

    PeanutOrderListType(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static PeanutOrderListType getEnum(String value) {
        for (PeanutOrderListType type : values()) {
            if (type.value.equals(value)) {
                return type;
            }
        }
        throw new IllegalParamException("非法的订单列表项分类枚举值：" + value);
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }
}
